<?php
/*$a1=array(-3=>"a", "08" => "b", "hello", "8" => "c", "world", NULL => "NULL");

echo "{$a1[-2]}", "<br />";
echo "{$a1["08"]}", "<br />";
echo "{$a1[0]}", "<br />";
echo "{$a1[8]}", "<br />";
echo "{$a1[9]}", "<br />";
echo ":", "{$a1[""]}", ":", "<br />";
echo ":", "{$a1[NULL]}", ":", "<br />";

$a1[] = 2;
echo "{$a1[8]}", "<br />";
var_dump($a1);*/
/*
$arr = array("one", "two", "three");
reset($arr);
while (list(, $value) = each($arr)) {
    echo "Value: $value<br />\n";
}

foreach ($arr as $value) {
    echo "Value: $value<br />\n";
}
*/
/*
$arr = array("one", "two", "three");
reset($arr);
while (list($key, $value) = each($arr)) {
    echo "Key: $key; Value: $value<br />\n";
}

foreach ($arr as $key => $value) {
    echo "Key: $key; Value: $value<br />\n";
}*/

/*
$a = array(
    "one" => 1,
    "two" => 2,
    "three" => 3,
    "seventeen" => 17
);

foreach ($a as $k => $v) {
    echo "\$a[$k] => $v.\n";
}
*//*
$b = array();
$b[0][0]="a";
$b[0][1]="b";
$b[1][0]="c";
$b[1][1]="d";

foreach ($b as $v1){
	foreach ($v1 as $v2) {
		echo "$v2<br/>";
	}
}

$foo[bar] = "hello";
echo $foo[bar];*/
/*
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('html_errors', false);

$a=array(1,2);
$count=count($a);
for($i = 0; $i < $count; $i++)
{
	echo "\nchecking $i:<br/>\n";
	echo "bad:" . $a["$i"] . "<br/>\n";
	echo "good:" . $a[$i] . "<br/>\n";
	echo "bad: {$a["$i"]} <br/>\n";
	echo "good: {$a[$i]} <br/>\n";
}
error_reporting(E_ALL);
$arr = array('fruit' => 'apple', 'veggie' => 'carrot');
print "Hello" . $arr[fruit];
print "Hello {$_GET['foo']}";*/

/*class A
{
	private $A;
}

class B extends A
{
	private $A;
	public $AA;
}

//var_dump((array)new B());
var_dump((array)NULL);*/
$colors = array('red', 'blue', 'green', 'yellow');

/*foreach ($colors as &$color)
{
	$color = strtoupper($color);
}
foreach ($colors as $key => $color)
{
	$colors[$key] = strtoupper($color);
}
unset($color);
var_dump($colors);
print_r($colors);*/
/*
$handle = opendir(".");
while (false !== ($file = readdir($handle)))
{
	$files[] = $file;
}
closedir($handle);
sort($files, SORT_NUMERIC);
print_r($files);*/

$arr1 = array(2, 3);
$arr2 = $arr1;
$arr2[] = 4; // $arr2 is changed,
             // $arr1 is still array(2, 3)
print_r($arr1);
print_r($arr2);
             
$arr3 = &$arr1;
$arr3[] = 4; // now $arr1 and $arr3 are the same

print_r($arr1);
print_r($arr3);
?>
